//
//  UIImageView+CPJImageView.m
//  成品家
//
//  Created by YYY on 2017/3/7.
//  Copyright © 2017年 成品家（北京）网路科技有限公司. All rights reserved.
//

#import "UIImageView+CPJImageView.h"

@implementation UIImageView (CPJImageView)

//设置显示图片
-(void)setImageStr:(NSString *)imageStr flag:(NSInteger)flag
{
    //flag 0:本地图片  1:网络图片
    flag == 1 ? ([self sd_setImageWithURL:[NSURL URLWithString:imageStr] placeholderImage:kPlaceHolderImage]) : (self.image = [UIImage imageNamed:imageStr]);
    self.userInteractionEnabled = YES;
}

//设置圆角图片
-(void)setRadiusImage:(CGFloat)radius imageStr:(NSString *)imageStr flag:(NSInteger)flag
{
    //flag 0:本地图片  1:网络图片
    flag == 1 ? ([self sd_setImageWithURL:[NSURL URLWithString:imageStr] placeholderImage:kPlaceHolderImage]) : (self.image = [UIImage imageNamed:imageStr]);
    self.layer.masksToBounds = YES;
    self.layer.cornerRadius = radius;
    self.userInteractionEnabled = YES;
}
@end
